<template>
	<uni-popup ref="download">
		<view class="block_1">
			
			<!-- <image class="close" src="../../static/close.png"></image> -->
			<!-- <image class="close" src="../../static/close.png" @click="close()"></image> -->
			<view class="text1">下载链接</view>
			
			<view  class="text2" >
				
				<view class="left_text1">
					<!-- <image src="../../static/my/android@2x.png"></image> -->
					
					<uni-link  
					color="#ffffff"
					showUnderLine='false'
					:href="android_download_url"
					 text="Android下载链接">Android下载链接</uni-link>
					<view class="label_1" @click="copy(android_download_url)">复制链接</view>
				</view>
			
			</view>
			
			
			<view class="text3" >
				
				<view class="left_text1 left_text2 ">
					
					<uni-link 
					color="#8C7444"
					showUnderLine='false'
					 :href="apple_download_url" 
					text="苹果下载链接">
						苹果下载链接
					</uni-link>
					<view class="label_1 label_2" @click="copy(apple_download_url)">复制链接</view>
				</view>
				
			
			</view>
			
			<view class="tip">
				温馨提示：如果点击下载链接无法下载，请使用浏览器打开此链接
			</view>
			
		</view>

	</uni-popup>
</template>

<script>
	export default {
		name:"download",
		data() {
			return {
				android_download_url:'',
				apple_download_url:''
			};
		},
			
		methods:{
			down(type){
				//  if (this.isWechat()) {
				// 	uni.showToast({
				// 		title: '点击右上角在浏览器中打开后下载',
				// 		icon: 'none',
				// 		duration: 3000
				// 	})
				// 	return
				// }
				// if(type == 1){
				// 	this.custom.tool.setClipboardText('https://app.xfenfa.cn/yj666STX', res => {}, fial => {})
				// }else{
				// 	this.custom.tool.setClipboardText('http://dmall.cdn.qufeiya.cn/appdownload/app.mobileconfigSTX', res => {}, fial => {})
				// }
				
			},
			open(androidUrl,iosUrl) {
				this.android_download_url = androidUrl;
				this.apple_download_url = iosUrl;
				this.$refs.download.open('center')
			},
			close(){
				this.$refs.download.close()
			},
			isWechat() {
			  return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
			},
			copy(text){
				this.custom.tool.setClipboardText(''+text, res => {}, fial => {})
			}
		}
	}
</script>

<style scoped lang="less">


.block_1{
	
	background: white;
	border-radius: 10rpx;
	// color: #ffffff;
	// height: 500rpx;
	width: 500rpx;
	padding: 20rpx;
	
	.tip{
		margin-top: 30rpx;
		color: red;
		
	}
	
	.close{
		width: 80rpx;
		height: 80rpx;
		position: absolute;
		top: -30rpx;
		right: -10px;
	}
	.text1{
		color: black;
		text-align: center;
	}
	
	.text2,.text3{
		
		text-align: center;
		margin-top: 40rpx;
		padding: 20rpx;
		// color: #ffffff;
		display: flex;
		text-align: center;
		background: linear-gradient(180deg, #FE903D 0%, #FE903D 100%);
		// box-shadow: 0px 5px 0px 0px rgba(26,119,17,1);
		border-radius: 23px;
		.left_text1{
			margin: auto;
			display: flex;
			color: white;
			image{
				width: 40rpx;
				height: 40rpx;
				margin-right: 10rpx;
			}
			.label_1{
				margin-left: 10px;
			}
			.label_2{
				color: #8C7444;
			}
		}
		
		.left_text2{
			// color: #8C7444;
		}
		
		
		
	}
	
	.text3{
		// color: #8C7444;
		background: linear-gradient(180deg, #E7CC99 0%, #EED4AA 100%);
		// box-shadow: 0px 5px 0px 0px RGBA(140, 116, 68, 1);
		
	}
	
	
}
</style>